package sv.gob.mh.dgii.dao.rc;

import java.util.List;
import java.util.Set;
import org.hibernate.Query;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;
import sv.gob.mh.dgii.dao.hibernate.HibernateDaoImpl;
import sv.gob.mh.dgii.model.DeRucPerfil;
import sv.gob.mh.dgii.model.RcSocio;

@Repository
public class RcSocioDaoImpl extends HibernateDaoImpl implements RcSocioDao {
	
	
	public final String _NIT ="id.nit";
	public final String _FFINAL ="ffsocio";
	
	
	public RcSocioDaoImpl(){
		super(RcSocio.class); 
	} 

    @Override
    public List<RcSocio> obtenerSocios(String nit) {
        String jpql = "SELECT soc FROM RcSocio soc LEFT JOIN FETCH soc.rcRucByNitSocio where soc.rcRucByNit.nit=:nit";
        Query q = getSessionFactory().getCurrentSession().createQuery(jpql);
        q.setParameter("nit", nit);
        return q.list();
    }
}